TARGETS=1k-all 5k-all 10k-all 30k-all 50k-all all-all
PARSERS=mst
#PARSERS=ip mst-ip

dumps:
	clear ; for f in `echo graph types strings features` ; do echo "=== $$f ===" ; cat dump.$$f ; echo ; done

configs:
	echo "Configurations"
	ls nbproject/configs | sed -e 's/.properties//g'
	echo
	echo "Results"
	cd out ; grep "Unlabeled" *.eval

all:
	for f in `echo ${TARGETS}` ; do for p in `echo ${PARSERS}` ; do make out/$$f-$$p.log out/$$f-$$p.eval; done ; done

out/%.log: 
	touch out/$*.log
	echo -e "\n\n***$****\n\n"
	JVMARGS=`grep run.jvmargs= nbproject/configs/$*.properties | sed -e 's/^[^=]*=//g'` ; \
	MAIN=`grep main.class= nbproject/configs/$*.properties | sed -e 's/^[^=]*=//g'` ; \
	ARGS=`grep application.args= nbproject/configs/$*.properties | sed -e 's/^[^=]*=//g'` ; \
	echo "java -server -cp dist/IncrementalParser.jar $$JVMARGS $$MAIN -eval.output1=out/$*.parser1.conll -eval.output2=out/$*.parser2.conll $$ARGS 2>&1 | tee out/$*.log" ; \
	java -server -cp dist/IncrementalParser.jar $$JVMARGS $$MAIN -eval.output1=out/$*.parser1.conll -eval.output2=out/$*.parser2.conll $$ARGS 2>&1 | tee out/$*.log

out/%.eval: out/%.log
	conll/eval.pl -g conll/eval.danish_ddt_train.conll -s out/$*.parser1.conll > out/$*.parser1.eval
	conll/eval.pl -g conll/eval.danish_ddt_train.conll -s out/$*.parser2.conll > out/$*.parser2.eval
	dtag -e "load out/$*.parser1.conll" -e "diff out/$*.parser2.conll" -e "print /tmp/dtag-diff.${PID}.ps" -e "quit"
	ps2pdf /tmp/dtag-diff.${PID}.ps out/$*.parser1diff2.pdf
	rm /tmp/dtag-diff.${PID}.ps


